import 'package:json_annotation/json_annotation.dart';
part 'collectList.g.dart';

@JsonSerializable()
class CollectListResult {
  final bool success;
  final String message;
  final List<CollectInfo> data;

  const CollectListResult(
    this.success,
    this.message,
    this.data,
  );

  factory CollectListResult.fromJson(Map json) =>
      _$CollectListResultFromJson(json);
  Map toJson() => _$CollectListResultToJson(this);
}

@JsonSerializable()
class CollectInfo {
  final int id;
  final int taskId;
  final int collectId;
  final String code;
  final String taskCode;
  final String subName;
  final String customerName;
  final String verdictType;
  final String verdictTypeText;
  final String checkTime;
  List<SpecInfo> specList;
  final List<String> picUrlList;

  CollectInfo(
    this.id,
    this.taskId,
    this.collectId,
    this.code,
    this.taskCode,
    this.subName,
    this.customerName,
    this.verdictType,
    this.verdictTypeText,
    this.checkTime,
    this.specList,
    this.picUrlList,
  );

  factory CollectInfo.fromJson(Map json) => _$CollectInfoFromJson(json);
  Map toJson() => _$CollectInfoToJson(this);
}

@JsonSerializable()
class SpecInfo {
  final int id;
  final String name;
  final String key;
  final String type;
  final String options;
  String value;

  SpecInfo(
    this.id,
    this.name,
    this.key,
    this.type,
    this.options,
    this.value,
  );

  factory SpecInfo.fromJson(Map json) => _$SpecInfoFromJson(json);
  Map toJson() => _$SpecInfoToJson(this);
}
